package tronglv.gs.view;

import java.util.ArrayList;

import com.example.paralletkill.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;


public class ThanhTichAdapter extends BaseAdapter {
	private Context context;
	private ArrayList<String> archiement = new ArrayList<String>();
	private LayoutInflater inflat;
//	private int image[] = new int[] {R.drawable.star3,R.drawable.star2,R.drawable.star1,R.drawable.star4};
	
	public ThanhTichAdapter(Context context, ArrayList<String> archiement){
		  this.context = context;
		  this.archiement = archiement;
		  inflat = LayoutInflater.from(context);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 10;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return archiement.get(arg0);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		final ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = inflat.inflate(R.layout.thanhtich_item, null,true);
//			holder.iv_tuong = (ImageView) convertView.findViewById(R.id.iv_ic1);
//			holder.nameAr = (TextView) convertView.findViewById(R.id.textView1);
//			holder.nameAr.setTypeface(Typeface.createFromAsset(context.getAssets(), "font/HHUMAN.TTF"));
//			holder.bonusAr = (TextView) convertView.findViewById(R.id.textView2);
//			holder.bonusAr.setTypeface(Typeface.createFromAsset(context.getAssets(), "font/HHUMAN.TTF"));
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
//		holder.ratingAr.setImageResource(image[archiement.get(position).getLevelArchi()]);
//		holder.nameAr.setText(archiement.get(position).getNameArchi());
//		holder.bonusAr.setText(archiement.get(position).getBonusArchi());
		return convertView;
	}
	
	private class ViewHolder{
		private TextView nameAr;
		private TextView bonusAr;
		private ImageView iv_tuong;
	}

	
}